<?php
/**
 * Start.php
 * 
 * @category 	Madoqua
 * @package 	Module
 * @subpackage 	Install
 */

/** base class */
require_once 'Madoqua/Form.php';

/** zend locale */
require_once 'Zend/Locale.php';

/**
 * Install_Index_Start
 * 
 * @category 	Madoqua
 * @package 	Module
 * @subpackage 	Install
 */
class Install_Index_Start extends Madoqua_Form
{
    /**
     * constructor
     * 
     * @todo make it so that the user can pick from a list of locations and find a matching locale
     */
    public function __construct()
    {
        parent::__construct();
        $this->addElement('text', 'name', array(
            'label' => 'Blog name',
            'validators' => array(
                array('StringLength', 255, 1)
            ),
            'filters' => array(
                'StringTrim'
            )
        ));
        //blog name
        
        $locales = Zend_Locale::getLocaleList();
        foreach($locales as $key => $val) {
            if (strlen(trim($key)) > 3) {
                $locales[$key] = $key;
            } else {
                unset($locales[$key]);
            }
        }
        //list of locales
        
//        $timezone = Zend_Locale::getTranslationList('TimezoneToTerritory');
        
        $this->addElement('select', 'locale', array(
            'multiOptions' => $locales,
            'label' => 'locale'
        ));
        //locale select


        $this->addElement('submit', 's', array(
            'label' => 'continue'
        ));
        
    }
}